<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link href="/css/layui.css" rel="stylesheet" media="all">
<script type="text/javascript">

    function getMap() {
        var id = document.getElementById('id').value;
       layer.open({
            type: 2,
            title: '地图',
            maxmin: true,
            shadeClose: false, // 点击遮罩关闭层
            area: ['800px', '520px'],
            content:  '/farm/farmShop/getLocation/' + id // iframe的url
        });
    }

   /* window.onload=function(){
        var id = document.getElementById('id').value;
        document.getElementById("map").onclick=function(){
            layer.open({
                type: 4,
                title: '地图',
                maxmin: true,
                shadeClose: false, // 点击遮罩关闭层
                area: ['800px', '520px'],
                content:  '/farm/farmShop/getLocation/' + id // iframe的url
            });
        }
        $('#map').trigger("click");
}*/


</script>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm">
                        <input id="id" name="id" th:value="${farmShop.id}" type="hidden">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">联系人姓名：</label>
                            <div class="col-sm-8">
                                <input id="name" name="name" th:value="${farmShop.name}" class="form-control"
                                       type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">联系人电话：</label>
                            <div class="col-sm-8">
                                <input id="phone" name="phone" th:value="${farmShop.phone}" class="form-control"
                                       type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">店铺照片：</label>
                            <div class="col-sm-6">
                                <button type="button" class="layui-btn layui-btn-normal" id="testList">选择图片</button>
                                <button type="button" class="layui-btn layui-btn-normal" id="shangchuan">上传图片</button>
                                <div class="layui-upload-list">
                                    <table class="layui-table">
                                        <thead>
                                        <tr>
                                            <th>图片名字</th>
                                            <th>大小</th>
                                            <th>状态</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody id="demoList"></tbody>
                                    </table>
                                </div>
                                <div class="col-auto">
                                    <ul id="imgList" class="titleTab" th:if="${scenicpictureArr != false}" th:value="${farmShop.storePhotos}" >
                                        <li th:each="scenicpic:${scenicpictureArr}" th:attr="data-id=${scenicpic}">
                                            <img style="width:60px;height:60px;" th:src="${scenicpic}" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <span class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除图片"><i class="fa fa-remove"></i></span>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <input type="text" id="imgUrls" name="storePhotos" th:value="${farmShop.storePhotos}" style="display: none;" class="layui-input">

                        <div class="form-group">
                            <label class="col-sm-3 control-label">店铺简介：</label>
                            <div class="col-sm-8">
                                <input id="title" name="title" th:value="${farmShop.title}" class="form-control"
                                       type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">人均消费(元/人)</label>
                            <div class="col-sm-8">
                                <input id="consumption" name="consumption" th:value="${farmShop.consumption}"
                                       class="form-control" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">住宿:</label>
                            <div class="col-sm-8">
                                <label class="radio-inline">
                                    <input type="radio"
                                           th:field="*{farmShop.accommodation}" name="type" value="1"/>
                                    正常
                                </label>
                                <label class="radio-inline">
                                    <input type="radio"
                                           th:field="*{farmShop.accommodation}" name="type" value="2"/>
                                    禁用
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">美食:</label>
                            <div class="col-sm-8">
                                <label class="radio-inline">
                                    <input type="radio"
                                           th:field="*{farmShop.diningRoom}" name="type" value="1"/>
                                    正常
                                </label>
                                <label class="radio-inline">
                                    <input type="radio"
                                           th:field="*{farmShop.diningRoom}" name="type" value="2"/>
                                    禁用
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">农家名称：</label>
                            <div class="col-sm-8">
                                <input id="farmName" name="farmName" th:value="${farmShop.farmName}"
                                       class="form-control" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">营业执照：</label>
                            <div class="col-sm-6">
                                <button type="button" class="layui-btn layui-btn-normal" id="testList2">选择图片</button>
                                <button type="button" class="layui-btn layui-btn-normal" id="shangchuan2">上传图片</button>
                                <div class="layui-upload-list">
                                    <table class="layui-table">
                                        <thead>
                                        <tr>
                                            <th>图片名字</th>
                                            <th>大小</th>
                                            <th>状态</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody id="demoList2"></tbody>
                                    </table>
                                </div>
                                <div class="col-auto">
                                    <ul id="imgList2" class="titleTab" th:if="${scenicpictureArr != false}" th:value="${farmShop.storePhotos}" th:each="scenicpic:${scenicpictureArr}">
                                        <li th:attr="data-id=${scenicpic}">
                                            <img style="width:60px;height:60px;" th:src="${scenicpic}" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <span class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除图片"><i class="fa fa-remove"></i></span>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <input type="text" id="imgUrls2" name="storePhotos" th:value="${farmShop.businessLicens}" style="display: none;" class="layui-input">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">审核状态:</label>
                            <div class="col-sm-8">
                                <label class="radio-inline">
                                    <input type="radio"
                                           th:field="*{farmShop.status}" name="type" value="1"/>
                                    通过
                                </label>
                              <!--  <label class="radio-inline">
                                    <input type="radio"
                                           th:field="*{farmShop.status}" name="type" value="2"/>
                                    审核中
                                </label>-->
                                <label class="radio-inline">
                                    <input type="radio"
                                           th:field="*{farmShop.status}" name="type" value="3"/>
                                    未通过
                                </label>
                            </div>

                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">热度：</label>
                            <div class="col-sm-8">
                                <input id="hotValue" name="hotValue" th:value="${farmShop.hotValue}"
                                       class="form-control" type="text"  readonly="readonly">
                            </div>
                        </div>

                     <div class="form-group">
                         <!--   <label class="col-sm-3 control-label">经度：</label>-->
                            <div class="col-sm-8">
                                <input id="lng" name="lng" th:value="${farmShop.lng}" class="form-control" type="hidden" >
                            </div>
                        </div>

                        <div class="form-group">
                       <!--   <label class="col-sm-3 control-label">纬度：</label>-->
                            <div class="col-sm-8">
                                <input id="lat" name="lat" th:value="${farmShop.lat}" class="form-control" type="hidden">
                            </div>
                        </div>
                        <div class="form-group">
                           <label class="col-sm-3 control-label">详细地址:</label>
                            <div class="col-sm-8">
                                <input id="address" name="address" th:value="${farmShop.address}" class="form-control"
                                       type="text" onclick="getMap()">
                            </div>
                        </div>



                        <div class="form-group">
                            <label class="col-sm-3 control-label">热门:</label>
                            <div class="col-sm-8">
                                <label class="radio-inline">
                                    <input type="radio"
                                           th:field="*{farmShop.recommend}" name="type" value="1"/>
                                    热门
                                </label>
                                <label class="radio-inline">
                                    <input type="radio"
                                           th:field="*{farmShop.recommend}" name="type" value="2"/>
                                    未热门
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">上下架</label>
                            <div class="col-sm-8">
                                <label class="radio-inline">
                                    <input type="radio"
                                           th:field="*{farmShop.updownStatus}" name="type" value="1"/>
                                    上架
                                </label>
                                <label class="radio-inline">
                                    <input type="radio"
                                           th:field="*{farmShop.updownStatus}" name="type" value="2"/>
                                    下架
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button type="submit" class="btn btn-primary">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script src="/js/content.js?v=1.0.0"></script>
<script src="/js/layui.js"></script>
<script src="/js/plugins/clipboard/clipboard.min.js"></script>
<script src="/js/plugins/layer/layer.min.js"></script>
<script type="text/javascript" src="/js/appjs/farm/farmShop/edit.js"/>
</body>
</html>
